package com.rem.chat.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: Themberfue
 * @date: 2025/6/16 16:18
 * @description:
 */
@AllArgsConstructor
@Getter
public enum MessageStatusEnum {
    SENDING(0, "发送中"),
    SENT(1, "已发送");

    private final Integer status;
    private final String desc;

    public static MessageStatusEnum getByStatus(Integer status) {
        try {
            for (MessageStatusEnum item: MessageStatusEnum.values()) {
                if (status.equals(item.getStatus())) {
                    return item;
                }
            }
            return null;
        } catch (Exception e) {
            return null;
        }
    }
}
